﻿@page "/counter"
@inject IHttpClientFactory ClientFactory
<PageTitle>Counter</PageTitle>
<h1>Counter</h1>

<Table1 IData="Yuan" Items="yuans">
    <Header>
    <th>测试</th>
    <th>测试1</th>
    <th>测试2</th>
    <th>测试3</th>
    <th>测试4</th>

    </Header>
    <Row>
        <td>@context.ProductsName</td>
        <td>@context.ProductsEncode</td>
        <td>@context.ProcessDescription</td>
        <td>@context.Id</td>
        <td>@context.Version</td>
        <td>@context.WjHz</td>
        <td>@context.State</td>

    </Row>

</Table1>
<p role="status">Current count: @currentCount</p>

<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>

@code {
    List<Yuan> yuans = new List<Yuan>();
    class Yuan
    {

        public int? Id { get; set; }
        public string? CraftId { get; set; }
        public string? CraftName { get; set; }
        public string? ProductsEncode { get; set; }
        public string? ProductsName { get; set; }
        public string? State { get; set; }
        public int? Version { get; set; }

        public string? ProcessDescription { get; set; }
        public string? Precautions { get; set; }
        public string? Wj { get; set; }
        public string? WjHz { get; set; }

        public List<object>? WorkstationAdddb { get; set; }
        public List<object>? WorkstationDb { get; set; }
    }



    protected override async Task OnInitializedAsync()
    {
        var client = ClientFactory.CreateClient();
        yuans = await client.GetFromJsonAsync<List<Yuan>>("http://47.110.85.142:44333/api/Values/Productprocess");


    }
    private int currentCount = 0;

    private void IncrementCount()
    {
        currentCount++;
    }
}
